using Vin.Extension.Framework.Upload.Options;
using Vin.Extension.Framework.Upload.ServiceInterface;
using Vin.Tool.AspNetCore.Singleton;

namespace Vin.Extension.Framework.Upload.Tools;

public class UploadTool
{
    /// <summary>
    /// 获取上传配置
    /// </summary>
    public static UploadOption UploadOption => VinApp.GetOption<UploadOption>();
    
    /// <summary>
    /// 获取默认的上传服务
    /// </summary>
    public static IUploadService DefaultUploadService =>
        VinApp.GetRequiredServiceByHttpContext<IUploadService>(UploadOption.ServiceKey);
}